<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>测试fromEvent</title>
</head>
<body>
<input id="inputText" type="text"/>
<script src="../node_modules/jquery/dist/jquery.js"></script>
<script src="../node_modules/rx/dist/rx.all.js"></script>
<script>
	let greetings = ['Hello', 'How are you', 'How are you doing'];
	let time = 3000;
	let item$ = Rx.Observable.from(greetings);
	let interval$ = Rx.Observable.interval(time);
	
	Rx.Observable.zip(
		item$,
		interval$,
		(item, index) => {
			return {
				item: item,
				index: index
			}
		}
	)
	.subscribe(result =>
		console.log(
			'item: ' + result.item +
			' index: ' + result.index +
			' at ' + new Date()));
</script>
</body>
</html>